<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type="text/javascript" src="jquery/jquery-1.11.3.js"></script>
        <script type="text/javascript">
            $(function(){
                //has返回新包装集
                //获取存在有ul 的li，返回的是新包装集 
                $("li").has("ul").css("color","#f00")
                        .end().css("background","#00f");
            
                //存在span的div
                $("div").has("span").css("color","#f00");
            });
        </script>
    </head>
    <body>
        <div>
            <span class="s1">ssssssssssssssss</span>
        </div>
        <div>
            <span>
                2222222222222222222
            </span>
        </div>
        <div>
            <ul class="u1">
                <li>aaaaaaaaaaaaaaaa</li>
            </ul>
        </div>
        
        <ul>
            <li>aaaa</li>
            <li>bbbb</li>
            <li>
                <ul>
                    <li>cccccc1</li>
                    <li>cccccc2</li>
                </ul>
            </li>
            <li>
                dddddd
            </li>
        </ul>
    </body>
</html>
